package jsyf.oa.facade.wechat.service_account;

import com.alibaba.dubbo.rpc.protocol.rest.support.ContentType;
import com.alibaba.fastjson.JSONObject;

import javax.ws.rs.Consumes;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Path("/weChatUserService")
@Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
@Produces({ContentType.APPLICATION_JSON_UTF_8, ContentType.TEXT_XML_UTF_8})
public interface WechatUserFacade {

    /**
     * 通过销售二维码关注公众号存储
     */
    @Path("/saveUserByeventKey")
    String saveUserByeventKey(String openId, String eventKey);

    @Path("/updateUserByOpenId")
    int updateUserByOpenId(String jsonDat, int status);

    @Path("/updateUserByCustomerTel")
    int updateUserByCustomerTel(String openId, String phone);

    @Path("/updateUserByEventKey")
    int updateUserByEventKey(String openId, String eventKey);

    @Path("/getOAUserByPhone")
    JSONObject getOAUserByPhone(String phone);

    @Path("/saveUserByOpenId")
    String saveUserByOpenId(String openId);

    @Path("/isExit")
    boolean isExit(String openId);

    @Path("/isExitByCustomerTel")
    boolean isExitByCustomerTel(String customerTel);

    @Path("/getAllUser")
    List<JSONObject> getAllUser();

    @Path("/getUserByPage")
    JSONObject getUserByPage(JSONObject jsonParam, int requestPage, int pageSize);
}